#pragma once

#include <iostream>
#include "Common.hpp"

class Client
{
public:
    Client():_fd(gdefaultfd)
    {}
    bool OpenPipeForWrite()
    {
        _fd = OpenPipe(OpenForWrite);
        if(_fd < 0) return false;
        return true;
    }
    int SendPipe(const std::string &in)
    {
        return ::write(_fd, in.c_str(), in.size());
    }
    void ClosePipe()
    {
        ClosePipeHelper(_fd);
    }
    ~Client()
    {}
private:
    int _fd;
};